<#import '/ftlLibrary/properteisVariable.ftl' as pv/>
<link href="assets/css/bootstrap-select.css" rel="stylesheet"/>
<link href="assets/css/modify.css" rel="stylesheet"/>
<script src="assets/js/select2/select2.js"></script>
<link href="assets/css/front/listCommonStyle.css" rel="stylesheet"/>
<style>
    th,td{
        height: 34.29px!important;
    }
    .iconchange1 .fa{
        color: #2a6496;
        font-size: 12px!important;
    }
    .s1{
        position  :absolute;
        top   :-20px;
        *top   :-22px;
        left   :20px;
        display  :block;
        height  :10px;
        width  :10px;
        font-size : 0;
        line-height : 0;
        border-color :transparent transparent #666 transparent;
        border-style :dashed dashed solid dashed;
        border-width :10px;
    }
    .i1{
        position  :absolute;
        top   :-9px;
        *top   :-9px;
        left   :-10px;
        display  :block;
        height  :10px;
        width  :10px;
        font-size : 0;
        line-height : 0;
        border-color :transparent transparent #fff transparent;
        border-style :dashed dashed solid dashed;
        border-width :10px;
    }


    .popover {
        position: absolute;
        top: 38px;
        left: 110px;
        z-index: 1000;
        display: none;
        max-width: 276px;
        padding: 1px;
        font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
        font-size: 14px;
        font-style: normal;
        font-weight: 400;
        line-height: 1.42857143;
        text-align: left;
        text-align: start;
        text-decoration: none;
        text-shadow: none;
        text-transform: none;
        letter-spacing: normal;
        word-break: normal;
        word-spacing: normal;
        word-wrap: normal;
        white-space: normal;
        background-color: #fff;
        -webkit-background-clip: padding-box;
        background-clip: padding-box;
        border: 1px solid #ccc;
        border: 1px solid rgba(0,0,0,.2);
        border-radius: 6px;
        -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2);
        box-shadow: 0 5px 10px rgba(0,0,0,.2);
        line-break: auto;
    }
    .popover-content a{
        text-wrap:normal!important;
    }
    .appendTdA{
        float: left;
        cursor: pointer;
        padding-bottom: 5px;
    }
    .businessBtns .basicInfoBtnt:nth-child(2){
        background-color: #23a8f5!important;
        color: #fff!important;
    }
    .businessBtns .basicInfoBtnt:nth-child(1){
        background-color: #fff!important;
        color: #4a647d!important;
    }
</style>
<div class="row margin-left-10">
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
        <div class="widget flat margin-top-0" style="margin: -10px 0 0px 0!important;">
            <div class="widget-header bordered-sky theme-bordered nopadding">
                <div class="widget-buttons widget-label nomargin-bottom">
                    <label class="businessBtns">
                        <ol class="breadcrumb" style="margin: 0;">
                            <li style="color: #809fa6;">会员管理</li>
                            <li class="active" style="color: #23a8f5;">过渡会员</li>
                        </ol>
                    </label>
                </div>
            </div>
        </div>
    </div>
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 margin-bottom-10 nopadding-right">
        <div class="widget searchCriteria flat margin-top-0" style="margin: 3px 0 0px 0!important;">
            <div class="widget-header bordered-sky theme-bordered nopadding">
                <div class="widget-buttons widget-label nomargin-bottom">
                    <label class="businessBtns">
                        <@hp code="HYGL22644030125229-qz_member_package"  params="[serializeNum=${serializeNum},packageType=1]" />
                        <@hp code="HYGL22644030125229-gd_member_package"  params="[serializeNum=${serializeNum},packageType=2]" />
                    </label>
                    <label class="pull-right businessBtns">
                        <label class="margin-right-20">
                            <a style="border-radius: 0px;border: none;background: #23a8f5 !important;"
                               class="btn btn-blue shiny download" onclick="inportExcle()"><i class="fa fa-download"></i>导入
                            </a>
                        </label>
                        <label class="margin-right-20">
                            <a style="border-radius: 0px;border: none;background: #23a8f5 !important;"
                               class="btn btn-blue shiny download" onclick="exportData('${searchFormId}','MemberInformation.xlsx')"><i class="fa fa-share"></i>导出
                            </a>
                        </label>
                        <label class="margin-right-20">
                            <a style="border-radius: 0px;border: none;background: #ffab00 !important;"
                               class="btn btn-warning shiny search "><i class="fa fa-search"></i>搜索
                            </a>
                        </label>
                        <label onclick="iconsChange()" style="margin-right: 6px">
                            <label>
                                <a class="iconsChangeA" style="width: 13px;height: 13px;cursor: pointer;background: url('assets/img/nav-img/icon_hidden.png');display: block;-webkit-user-select:none; -moz-user-select:none; -ms-user-select:none;user-select:none;" value="1"></a>
                            </label>
                            <label style="color: #23a8f5 ;vertical-align: middle;padding-top:4px;">
                                <span class="iconsChangeSpan" style="-webkit-user-select:none; cursor: pointer;-moz-user-select:none; -ms-user-select:none;user-select:none;">隐藏搜索栏</span>
                            </label>
                        </label>
                    </label>
                </div>
            </div>
        </div>
    </div>
    <!-- 映射列表 -->
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
        <!--<div class="widget flat searchCriteria">-->
            <!--<div class="widget-header bordered-sky theme-bordered nopadding">-->
                <!--<div class="widget-buttons" style="margin-bottom: 10px!important;">-->
                    <!--&lt;!&ndash; 业务按钮 begin &ndash;&gt;-->
                    <!--<label class="businessBtns">-->
                        <!--&lt;!&ndash;<button style="border-radius: 0px;border: none;background: #ffab01 !important;"&ndash;&gt;-->
                                <!--&lt;!&ndash;class="btn btn-warning shiny add margin-right-40" serializeNum="${serializeNum}" editUrl="${editUrl}"><i class="fa fa-plus"></i>新增过渡会员</button>&ndash;&gt;-->
                        <!--<button style="border-radius: 0px;border: none;background: #23a8f5 !important;"-->
                                <!--class="btn btn-blue shiny download" onclick="exportData('${searchFormId}','MemberInformation.xlsx')"><i class="fa fa-share"></i>导出-->
                        <!--</button>-->
                        <!--<label >-->
                            <!--<form method="POST" id="fid" action="" enctype="multipart/form-data" class="nomargin-bottom" >-->
                                <!--<input type="hidden" name="" value="1"/>-->
                                <!--<label >-->
                                    <!--<input type="file" name="filePath">-->
                                <!--</label>-->
                                <!--<label>-->
                                    <!--<button style="border-radius: 0px;border: none;background: #23a8f5 !important;" class="btn btn-blue shiny download margin-right-40" onclick="inportExcle()"><i-->
                                            <!--class="fa fa-download"></i>导入-->
                                    <!--</button>-->
                                <!--</label>-->
                            <!--</form>-->
                        <!--</label>-->
                    <!--</label>-->
                    <!--&lt;!&ndash; 业务按钮 end &ndash;&gt;-->
                <!--</div>&lt;!&ndash;Widget Buttons&ndash;&gt;-->
            <!--</div>&lt;!&ndash;Widget Header&ndash;&gt;-->
        <!--</div>&lt;!&ndash;Widget&ndash;&gt;-->

        <div class="search_Bar" style="vertical-align: middle">
            <form id="${searchFormId}" action="${actionUrl}" class="searchConditions" method="POST">
                <input type="hidden" value="2" name="type">
                <div class="row searchInput" style="margin: 0;">
                    <label class="iconchange1 hidden" style="position: absolute;right: 10px;top: 0px;" >
                        <a class="search_Bar_A" id="iconchangemore" style="color: #2a6496;cursor: pointer;" onclick="iconchangeShow(this)" value="1">筛选更多<i class="fa fa-chevron-down" style="padding-left: 5px"></i></a>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">会员姓名：</label>
                        <label>
                            <input type="text" name="name" value="${search_map.name[0]}"
                                   style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">会员昵称：</label>
                        <label>
                            <input type="text" name="nickName" value="${search_map.nickName[0]}"
                                   style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">联系电话：</label>
                        <label>
                            <input type="text" name="contactPhone" value="${search_map.contactPhone[0]}"
                                   style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">会员年龄：</label>
                            <select class="form-select-1" style="width: 90px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;padding-left: 0px!important;padding-right: 0px!important;" name="age_begin" >
                                <@dictionary groupCode="stuAge";dics>
                                <#list dics as dic>
                                    <option value="${dic.code}">${dic.value}</option>
                                </#list>
                            </@dictionary>
                            </select>
                            至
                            <select class="form-select-1" style="width: 90px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;padding-left: 0px!important;padding-right: 0px!important;" name="age_end" >
                                <@dictionary groupCode="stuAge";dics>
                                <#list dics as dic>
                                    <option value="${dic.code}">${dic.value}</option>
                                </#list>
                            </@dictionary>
                            </select>
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">可用课时包：</label>
                            <select class="form-select-1" style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;" name="usableTotal" >
                                <@dictionary groupCode="usableTotal";dics>
                                    <#list dics as dic>
                                        <option value="${dic.code}">${dic.value}</option>
                                    </#list>
                                </@dictionary>
                             </select>
                        </label>
                    </label>
                    <!--<label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">-->
                        <!--<label style="width: 78px">所属顾问：</label>-->
                        <!--<label>-->
                            <!--<select id="realName"  class="form-select-1" style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;" name="realName">-->
                            <!--</select>-->
                        <!--</label>-->
                    <!--</label>-->
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">会员生日：</label>
                        <label>
                            <input id="d4313" type="text" name="birthdayDate_begin" class="beginValue Wdate" value="${search_map.birthdayDate_begin[0]}"
                                   onFocus="WdatePicker({doubleCalendar:true,maxDate:'#F{$dp.$D(\'d4314\')}',dateFmt:'MM-dd'})" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;"> 至
                            <input id="d4314"  type="text" name="birthdayDate_end" class="endValue Wdate"  value="${search_map.birthdayDate_end[0]}"
                                   onFocus="WdatePicker({doubleCalendar:true,minDate:'#F{$dp.$D(\'d4313\')}',dateFmt:'MM-dd'})" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">延期次数：</label>
                        <select class="form-select-1" style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;" name="postponeTime" >
                            <@dictionary groupCode="postponeTime";dics>
                            <#list dics as dic>
                                <option value="${dic.code}">${dic.value}</option>
                            </#list>
                        </@dictionary>
                        </select>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">报班状态：</label>
                        <select class="form-select-1" style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;" name="isAttendClass" >
                            <option value="">请选择</option>
                            <option value="true">是</option>
                            <option value="false">否</option>
                        </select>
                    </label>

                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">加减课时：</label>
                        <select class="form-select-1" style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;" name="isAddSubtract" >
                            <option value="">请选择</option>
                            <option value="true">是</option>
                            <option value="false">否</option>
                        </select>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">报名状态：</label>
                        <select class="form-select-1" style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;" name="applyStatus" >
                            <@dictionary groupCode="applyStatus";dics>
                            <#list dics as dic>
                                <option value="${dic.code}">${dic.value}</option>
                            </#list>
                        </@dictionary>
                        </select>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">报名日期：</label>
                        <label>
                            <input id="d4315" type="text" name="turnIntoMemberDate_begin" class="beginValue Wdate" value="${search_map.turnIntoMemberDate_begin[0]}"
                                   onFocus="WdatePicker({doubleCalendar:true,maxDate:'#F{$dp.$D(\'d4316\')}',dateFmt:'yyyy-MM-dd'})" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;"> 至
                            <input id="d4316"  type="text" name="turnIntoMemberDate_end" class="endValue Wdate"  value="${search_map.turnIntoMemberDate_end[0]}"
                                   onFocus="WdatePicker({doubleCalendar:true,minDate:'#F{$dp.$D(\'d4315\')}',dateFmt:'yyyy-MM-dd'})" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">报班日期：</label>
                        <label>
                            <input id="d4317" type="text" name="attendTime_begin" class="beginValue Wdate" value="${search_map.attendTime_begin[0]}"
                                   onFocus="WdatePicker({doubleCalendar:true,maxDate:'#F{$dp.$D(\'d4318\')}',dateFmt:'yyyy-MM-dd'})" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;"> 至
                            <input id="d4318"  type="text" name="attendTime_end" class="endValue Wdate"  value="${search_map.attendTime_end[0]}"
                                   onFocus="WdatePicker({doubleCalendar:true,minDate:'#F{$dp.$D(\'d4317\')}',dateFmt:'yyyy-MM-dd HH:mm:ss'})" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="min-width: 91px">剩余课时总数：</label>
                        <label>
                            <input type="text" name="surplusTotalClassHours_begin" value="${search_map.surplusTotalClassHours_begin[0]}"
                                   style="width: 89px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                            至
                            <input type="text" name="surplusTotalClassHours_end" value="${search_map.surplusTotalClassHours_end[0]}"
                                   style="width: 89px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">激活剩余有效期：</label>
                        <label>
                            <input type="text" name="surplusActivateValidDate_begin" value="${search_map.surplusActivateValidDate_begin[0]}"
                                   style="width: 89px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                            至
                            <input type="text" name="surplusActivateValidDate_end" value="${search_map.surplusActivateValidDate_end[0]}"
                                   style="width: 89px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="min-width: 91px">剩余激活课时：</label>
                        <label>
                            <input type="text" name="surplusActivateClassHours_begin" value="${search_map.surplusActivateClassHours_begin[0]}"
                                   style="width: 89px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                            至
                            <input type="text" name="surplusActivateClassHours_end" value="${search_map.surplusActivateClassHours_end[0]}"
                                   style="width: 89px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                        </label>
                    </label>
                </div>
            </form>
        </div>

        <div class="widget flat radius-bordered" style="margin-top: 0px;box-shadow:0px 0px 10px rgba(122,161,184,0.3);">
            <div class="widget-body no-padding">
                <div class="topPagingBar hidden">
                    ${pagingBar}
                </div>
                <div class="table-scrollable" style="border: none;" id="tableScrollable">
                    <!-- 数据表列信息列表 -->
                    <table class="table table-hover dataTable newtable">
                        <input type="hidden" name="memberType" class="memberType" value="${memberType}">
                        <thead>
                        <tr>
                            <th title="选择" class="checkboxColumnTh">
                                <div class="checkbox">
                                    <label>
                                        <input type="checkbox" class="chkAll" name="ck">
                                        <span class="text"></span>
                                    </label>
                                </div>
                            </th>
                            <th title="属性名">序号</th>
                            <th style="text-align: center">操作</th>
                            <th title="会员姓名">会员姓名</th>
                            <th title="会员年龄">会员年龄</th>
                            <th title="会员生日">会员生日</th>
                            <th title="联系电话">联系电话</th>
                            <th title="报名状态">报名状态</th>
                            <th title="报班状态">报班状态</th>
                            <th title="可用课时包">可用课时包</th>
                            <th title="剩余可用出勤天数">剩余可用出勤天数</th>
                            <th title="剩余激活天数">剩余激活天数</th>
                            <th title="激活剩余有效期">激活剩余有效期</th>
                            <th title="延期次数">延期次数</th>
                            <th title="加减课时">加减课时</th>
                            <th title="所属顾问">所属顾问</th>
                            <th title="报名日期">报名日期</th>
                            <th title="操作人">操作人</th>
                        </tr>
                        </thead>
                        <tbody class="iconchangeArrowBody">
                        <#if page_bean.list?size==0>
                            <tr>
                                <td align="center">无数据</td>
                            </tr>
                        </#if>
                        <#list page_bean.list as data>
                            <tr>
                                <td class="checkboxColumnTd">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" class="chk" name="id" value="${data.id}">
                                            <span class="text"></span>
                                        </label>
                                    </div>
                                </td>
                                <td>${data_index+1+(page_bean.pageNo-1)*page_bean.pageSize}</td>
                                <td align="center" style="position: relative" class="iconDialogTd">
                                    <@hp code="HYGL22644030125229-list_attend_class_gd" params="[serializeNum=${serializeNum},targetDataId=${data.memberId}]" />

                                    <@hp code="HYGL22644030125229-list_package_postpone_gd" params="[serializeNum=${serializeNum},targetDataId=${data.memberId},memberPackageId=${data.id}]" />

                                    <@hp code="HYGL22644030125229-list_return_class_gd" params="[serializeNum=${serializeNum},targetDataId=${data.id}]" />

                                    <@hp code="HYGL22644030125229-list_return_premium_gd" params="[serializeNum=${serializeNum},targetDataId=${data.memberId}]" />

                                    <@hp code="HYGL22644030125229-list_continue_apply_gd" params="[serializeNum=${serializeNum},targetDataId=${data.memberId}]" />

                                    <@hp code="HYGL22644030125229-list_add_subtract" params="[serializeNum=${serializeNum},targetDataId=${data.memberId}]" />

                                    <@hp code="HYGL22644030125229-list_turn_history" params="[serializeNum=${serializeNum},targetDataId=${data.memberId},targetName=${data.name},packageName=${data.packageName}]" />

                                    <a style="padding-left: 5px;position:relative;" class="iconchangeTd hidden" onclick="iconchangeArrow(this)" value="0">
                                        <i class="fa fa-sort-desc" style="position: absolute;top: 0;left: 3px;"></i>
                                    </a>
                                    <div class="popover fade in hidden text-align-center " style="display: block;width: 90px" >
                                        <s class="s1">
                                            <i class="i1"></i>
                                        </s>
                                        <div class="popover-content" >
                                        </div>
                                    </div>

                                </td>
                                <td  serializeNum="${serializeNum}" class="detailTd" style="color: #2679b8;cursor: pointer"
                                     targetDataId="${data.memberId}" flag="1">
                                    ${(data.name???string(data.name?html,"未设置"))!'未设置'}
                                </td>
                                <td>${(data.age???string(data.age?html,"未设置"))!'未设置'}</td>
                                <td>
                                    ${(data.birthdayDate???string(data.birthdayDate?html,"未设置"))!'未设置'}
                                </td>
                                <td>${(data.contactPhone???string(data.contactPhone?html,"未设置"))!'未设置'}</td>
                                <td> <@dictionary groupCode="applyStatus" dictionaryCode="${data.applyStatus}" ;applyStatus>${applyStatus.value }</@dictionary></td>
                                <td>${data.isAttendClass?string("是","否")}</td>
                                <td>
                                    <a onclick="showMemberDetailById(this)" serializeNum="${serializeNum}"
                                       targetDataId="${data.memberId}" flag="2">${(data.usableTotal???string(data.usableTotal?html,"未设置"))!'未设置'}
                                    </a>
                                </td>
                                <td>
                                    ${(data.surplusTotalClassHours???string(data.surplusTotalClassHours?html,"未设置"))!'未设置'}
                                </td>
                                <td>
                                    ${(data.surplusActivateClassHours???string(data.surplusActivateClassHours?html,"未设置"))!'未设置'}
                                </td>
                                <td>
                                    ${(data.surplusActivateValidDate???string(data.surplusActivateValidDate?html,"未设置"))!'未设置'}
                                </td>
                                <td>
                                    ${(data.postponeTime???string(data.postponeTime?html,"未设置"))!'未设置'}
                                </td>
                                <td>${data.isAddSubtract?string("是","否")}</td>
                                <td>${(data.realName???string(data.realName?html,"未设置"))!'未设置'}</td>
                                <td>${(data.turnIntoMemberDate???string(data.turnIntoMemberDate?html,"未设置"))!'未设置'}</td>
                                <td>${(data.userName???string(data.userName?html,"未设置"))!'未设置'}</td>
                            </tr>
                        </#list>
                        </tbody>
                    </table>
                </div>
                ${pagingBar}
            </div>
        </div>

    </div>
</div>
<script>
    $(".selectpicker").select2();
    /**
     * 请求列表
     * @param that
     */
    function requestPackageList(that) {
        var type = $(that).attr("packageType");
        javascript:toView('tssMemberPackageController/tssMemberPackageList.do?type='+type, true, 'POST', {pageSize: 10})
    }
    /**
     * 转会员
     * @param that
     */
    function showTurnHistory(that) {
        var handleContent=$(that).attr("packageName")+",转恢复";
        var targetdataId = $(that).attr("targetDataId");
        var targetName = $(that).attr("targetName");
        var serializeNum = $(that).attr("serializeNum");
        getTopWin().bootbox.dialog({
            title: '<i class="fa fa-lock red"></i>&nbsp;&nbsp;过渡转过渡',
            message: '您确定要将客户' + targetName + '转为历史会员吗',
            closeButton: true,
            buttons: {
                "确定": {
                    className: "btn-blue",
                    callback: function () {
                        ajaxRequest("tssStudentController/updateStatus.do", {
                            serializeNum: serializeNum,
                            targetDataId: targetdataId,
                            handleContent:handleContent,
                            status: 6
                        }, function (result) {
                            alert("转历史会员成功");
                            if (result.resCode == 200) {
                                bootbox.hideAll();
                            }
                        }, function () {
                            ajaxError("加载页面失败!")
                        }, "post", "html")
                    }
                },
                "取消": {
                    className: "btn-blue",
                    callback: function () {
                        return false;
                    }
                }
            }
        });
    }
    $("#tableScrollable").on("click",".showTurnHistoryTd",function () {

        var handleContent=$(this).attr("packageName")+",置为无效";
        var targetdataId = $(this).attr("targetDataId");
        var targetName = $(this).attr("targetName");
        var serializeNum = $(this).attr("serializeNum");
        getTopWin().bootbox.dialog({
            title: '<i class="fa fa-lock red"></i>&nbsp;&nbsp;亲子转历史',
            message: '您确定要将客户' + targetName + '转为历史会员吗',
            closeButton: true,
            buttons: {
                "确定": {
                    className: "btn-blue",
                    callback: function () {
                        ajaxRequest("tssStudentController/updateStatus.do", {
                            serializeNum: serializeNum,
                            targetDataId: targetdataId,
                            handleContent:handleContent,
                            status: 6
                        }, function (result) {
                            alert("转历史会员成功");
                            if (result.resCode == 200) {
                                bootbox.hideAll();
                            }
                        }, function () {
                            ajaxError("加载页面失败!")
                        }, "post", "html")
                    }
                },
                "取消": {
                    className: "btn-blue",
                    callback: function () {
                        return false;
                    }
                }
            }
        });

    })

    /**
     * 报班
     * @param that
     */
    $("#tableScrollable").on("click",".showDialogAttendClassTd",function () {
        var serializeNum = $(this).attr("serializeNum");
        var targetdataId = $(this).attr("targetDataId");
        var type = $(".memberType").val();
        /*alert(type);*/
        ajaxRequest("tssMemberPackageController/getListByMemberId.do", {
            serializeNum: serializeNum,
            memberId: targetdataId,
            type: 2
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "过度会员报班",
                className: 'myDialog'
            });
            $(".modal-header").find(".bootbox-close-button").removeClass("close");
            $(".modal-header").find(".bootbox-close-button").html("");
        }, function () {
            ajaxError("加载页面失败!")
        }, "post", "html")
    })


    /**
     * 延期
     * @param that
     */
    $("#tableScrollable").on("click",".showDialogPackagePostponeTd",function () {
        var targetdataId = $(this).attr("targetDataId");
        var memberPackageId = $(this).attr("memberPackageId");
        ajaxRequest("tssPackagePostponeController/tssPackagePostponeListByMemberId.do", {
            pageSize: 10,
            targetdataId: targetdataId,
            memberPackageId: memberPackageId,
            type: 1
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "亲子延期",
                className: 'myDialog familyMemberDialog'
            });
            $(".modal-header").find(".bootbox-close-button").removeClass("close");
            $(".modal-header").find(".bootbox-close-button").html("");
        }, function () {
            ajaxError("加载页面失败!")
        }, "post", "html")
    })

    /**
     * 退班
     * @param that
     */
    $("#tableScrollable").on("click",".showDialogReturnClassTd",function () {
        var targetdataId = $(this).attr("targetDataId");
        ajaxRequest("tssMemberAttendClassRecordController/getShouldReturnClassPackageListByMemberId.do", {
            pageSize: 10,
            targetdataId: targetdataId,
            type: 1
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "亲子退班",
                className: 'myDialog familyMemberDialog',
                width: 1000
            });
            $(".modal-header").find(".bootbox-close-button").removeClass("close");
            $(".modal-header").find(".bootbox-close-button").html("");
        }, function () {
            ajaxError("加载页面失败!")
        }, "post", "html")
    })


    /**
     * 退费
     * @param that
     */
    $("#tableScrollable").on("click",".showDialogReturnPremiumTd",function () {
        var serializeNum = $(this).attr("serializeNum");
        var targetdataId = $(this).attr("targetDataId");
        var type = $(".memberType").val();
        ajaxRequest("tssMemberPackageController/getShouldReturnPremiumListByMemberId.do", {
            serializeNum: serializeNum,
            memberId: targetdataId,
            type: 1
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "亲子退费",
                className: 'myDialog familyMemberDialog',
            });
        }, function () {
            ajaxError("加载页面失败!")
        }, "post", "html")
    })

    /**
     * 续报
     * @param that
     */
    $("#tableScrollable").on("click",".showDialogContinueApplyTd",function () {
        var targetdataId = $(this).attr("targetdataid");
        var serializeNum = $(this).attr("serializeNum");
        ajaxRequest("tssPaymentController/toAddedPaymentView.do", {
            serializeNum: serializeNum,
            targetdataid: targetdataId
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "亲子课时包",
                className: 'myDialog familyMemberDialog'
            });
        }, function () {
            ajaxError("加载页面失败!")
        }, "get", "html")
    })

    /**
     * 获取会员详情
     * @param that
     */
    $("#tableScrollable").on("click",".detailTd",function () {
        var serializeNum = $(this).attr("serializeNum");
        var targetdataId = $(this).attr("targetDataId");
        var flag = $(this).attr("flag");
        ajaxRequest("tssStudentController/getMemberDetailById.do", {
            serializeNum: serializeNum,
            memberId: targetdataId,
            type: 2,
            flag: flag
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "会员详情",
                className: 'myDialogDetail'+flag,
            });
            $(".modal-header").find(".bootbox-close-button").removeClass("close");
            $(".modal-header").find(".bootbox-close-button").html("");
        }, function () {
            ajaxError("加载页面失败!")
        }, "get", "html")
    })

    /**
     * 加减课时
     * @param that
     */
    $("#tableScrollable").on("click",".showDialogAddSubtractTd",function () {
        var serializeNum = $(this).attr("serializeNum");
        var targetdataId = $(this).attr("targetDataId");
        var type = $(".memberType").val();
        ajaxRequest("tssMemberPackageController/getShouldAddSubtractListByMemberId.do", {
            serializeNum: serializeNum,
            memberId: targetdataId,
            type: 1
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "亲子加减课时",
                className: 'myDialog familyMemberDialog',
            });
        }, function () {
            ajaxError("加载页面失败!")
        }, "post", "html")
    })

    /**
     * 导出数据
     * @param formId 条件表单id
     * @param templateName 导出的文件名
     */
    function exportData(formId, templateName) {
        var ids = "";
        $("[name='id']:checked").each(function(){
            ids += "," +$(this).val();
        });
        ids = ids.substring(1);
        var params = $("#" + formId).serialize();
        var exportIframe = ' <iframe class="hidden" id="exportIframe" name="exportIframe"></iframe>';
        var exportSrc ="tssMemberPackageController/exportExcle.do";
        var $exportForm = $('<form method="post" target="exportIframe" action="' + exportSrc + '" id="exportForm"></form>');
        $("#" + formId).find("input").map(function (i, input) {
            var $input = $(input);
            var name = $input.attr("name");
            var val = $input.val();
            if (name) {
                $exportForm.append('<input type="hidden" name="' + name + '" value="' + val + '">');
            }
        });

        //追加参数
        $exportForm.append('<input type="hidden" name="ids" value="'+ids+'">');
        $exportForm.append('<input type="hidden" name="templateName" value="' + templateName + '">');
        $exportForm.append('<input type="hidden" name="loginAdminUserId" value="${loginUserId}">');

        /**
         * 定义标识
         * @param flag:代表有无条件参数
         * @param type:会员类型(1:亲子会员,2:过渡会员,3:亲子历史会员,4:过渡历史会员)
         * */
        var flag = 0;
        var type = 2;
        var stuId = $("[name='stuId']").val();
        var age = $("[name='age']").val();

        if (stuId != "" || stuAge != ""){
            $exportForm.append('<input type="hidden" name="stuId" value='+stuId+'>');
            $exportForm.append('<input type="hidden" name="stuAge" value='+stuAge+'>');
            //if(usableTotalClassHour != ""){$exportForm.append('<input type="hidden" name="usableTotalClassHour" value='+usableTotalClassHour+'>');}
            flag = 1;
        }


        $exportForm.append('<input type="hidden" name="flag" value='+flag+'>');
        $exportForm.append('<input type="hidden" name="type" value='+type+'>');

        //删除并提交表单
        $("body #exportIframe").remove();
        $("body #exportForm").remove();
        $("body").append(exportIframe);
        $("body").append($exportForm);
        $exportForm.submit();
    };

    /**
     * 导入excel
     * 杨然
     * */
    function inportExcle(){

        ajaxRequest("tssStudentController/Jump.do", {
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "数据导入",
                className: 'myDialog inportExcleDialog'
            });
            $(".modal-header").find(".bootbox-close-button").removeClass("close");
            $(".modal-header").find(".bootbox-close-button").html("");
        }, function () {
            ajaxError("加载页面失败!")
        }, "get", "html")


    }

    //    隐藏显示搜索
    function iconsChange() {
        if($(".iconsChangeA").val()==1){
            $(".iconsChangeA").val("0");
            $(".iconsChangeA").css("background","url('assets/img/nav-img/icon_hidden.png')");
            $(".iconsChangeSpan").html("隐藏搜索栏");
            $(".search_Bar").removeClass("hidden");
        }else{
            $(".iconsChangeA").val("1");
            $(".iconsChangeA").css("background","url('assets/img/nav-img/icon_show.png')");
            $(".iconsChangeSpan").html("显示搜索栏");
            $(".search_Bar").addClass("hidden");
        }
    }

    //    筛选下拉框
    setTimeout(function () {
        var size = $(".search_Bar_item").size();
        if (size > 8) {
            $(".iconchange1").removeClass("hidden");
            $(".search_Bar_item").each(function () {
                var index = $(this).index();
                if (index <= 8) {
                    $(this).removeClass("hidden")
                }

            })
        } else {
            $(".iconchange1").addClass("hidden");
            $(".search_Bar_item").each(function () {
                $(this).removeClass("hidden")
            })
        }

        $(".iconDialogTd").each(function (tr,trItem) {
            var $tr = $(trItem);
            var sizeTd = $tr.find(".showDialogTd").size();
            if(sizeTd>5){
                $tr.find(".iconchangeTd").removeClass("hidden");
                $tr.find(".showDialogTd").each(function (a,aItem) {
                    var $a = $(aItem);
                    if(($a.index()+1)>5){
                        var html = $a.get(0);
                        $a.remove();
                        $tr.find(".popover-content").get(0).append(html);
                        $a.addClass("appendTdA")

                    }
                })

            }else{
                $tr.find(".iconchangeTd").addClass("hidden");
                $tr.find(".showDialogTd").each(function () {
                    $tr.removeClass("hidden");
                })
            }
        })

    }, 10);

    function iconchangeShow(that) {

        if($(that).attr("value")==1){
            $(that).attr("value","0");
            $(".iconchange1 .fa").removeClass("fa-chevron-down").addClass("fa-chevron-up");
            $(".search_Bar_item").each(function () {
                $(this).removeClass("hidden")
            })
        }else{
            $(that).attr("value","1");
            $(".iconchange1 .fa").removeClass("fa-chevron-up").addClass("fa-chevron-down");
            $(".search_Bar_item").each(function () {
                var index = $(this).index();
                if (index <= 8) {
                    $(this).removeClass("hidden")
                }else{
                    $(this).addClass("hidden")
                }

            })
        }

    }

    function iconchangeArrow(that) {
        $(".iconchangeArrowBody").find(".iconchangeTd").each(function () {
            $(this).find(".fa").removeClass("fa-sort-up").addClass("fa-sort-desc");
            $(this).find(".fa").css("top","0px");
        });
        $(".iconchangeArrowBody").find(".popover").each(function () {
            $(this).addClass("hidden");
        })

        if($(that).attr("value")==0) {
            $(that).attr("value","1");
            $(that).find(".fa").removeClass("fa-sort-desc").addClass("fa-sort-up");
            $(that).find(".fa").css("top","5px");
            $(that).next().removeClass("hidden");

        }else{
            $(that).attr("value","0");
            $(that).find(".fa").removeClass("fa-sort-up").addClass("fa-sort-desc");
            $(that).find(".fa").css("top","0px");
            $(that).next().addClass("hidden");
        }
    }
</script>
<script>
    $(function(){
        ajaxRequest("sysAdminUserController/getPostListByDuty.do",{
            duty:1
        }, function (result) {
            var data=result.data;
            var arr=['']; //<option value="0">请选择</option>
            for (var i = 0; i< data.length; i++) {
                arr.push('<option value="'+data[i].id+'">'+data[i].realName+'</option>')
            }
            $("#realName").html(arr.join(''))
        },function(){
            ajaxError("加载员工信息失败");
        }, "post","json")
    });
    $(".selectpicker_${serializeNum}").select2();
    $("#editForm_${serializeNum}").bind("ajaxSubmitCallback", function (event, result) {
        if (result.resCode == 200) {
            bootbox.hideAll();
        }
    });
</script>